<template>
	<view class="main-admin">
		<view class="admin-comm-list">
			<view class="item">
				<view class="header">
					<view class="left text-cut">《关于我们》</view>
					<view class="right">
						<view class="btn" @click="handleEdit">
							<image src="/static/编辑.png" mode="aspectFill" />
							<text class="icon-edit">编辑</text>
						</view>
						<view class="btn" @click="handlePreview">
							<image src="/static/眼睛.png" mode="aspectFill" />
							<text class="icon-attention">预览</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	// 编辑
	function handleEdit() {
		uni.navigateTo({
			url: '/pages/admin/AboutUs/edit/admin_AboutUs_edit'
		});
	}

	// 预览
	function handlePreview() {
		uni.navigateTo({
			url: '/pages/admin/AboutUs/preview/admin_AboutUs_preview'
		});
	}
</script>

<style scoped>
	.main-admin {
		padding: 20px;
	}

	.admin-comm-list {
		border-radius: 10px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	}

	.item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #ebebeb;
		padding-bottom: 20px;
		margin-bottom: 20px;
	}

	.header {
		display: flex;
		align-items: center;
		width: 100%;
	}

	.left {
		font-size: 20px;
		font-weight: 500;
		color: #333;
	}

	.right {
		display: flex;
		justify-content: center;
		position: relative;
		left: 40px;
	}

	.btn {
		display: flex;
		gap: 3px;
		/* 图片与文本之间的间距 */
		padding: 10px 15px;
	}

	.btn image {
		width: 20px;
		height: 20px;
	}

	.icon-edit,
	.icon-attention {
		font-size: 16px;
	}

	.text-cut {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.item:last-child {
		border-bottom: none;
		margin-bottom: 0;
		padding-bottom: 0;
	}
</style>